package com.lanou3g.ptp.achievement.service.impl;

import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.dubbo.config.annotation.Service;
import com.lanou3g.ptp.achievement.mapper.CommentMapper;
import com.lanou3g.ptp.achievement.service.CommentService;
import com.lanou3g.ptp.entity.Comment;
import com.lanou3g.ptp.entity.Diary;
import com.lanou3g.ptp.entity.Like;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;
import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {

    @Autowired
    private CommentMapper commentMapper;


    @Override
    public void insert(Comment comment) {
        comment.setCreateTime(new Date());
        comment.setUpdateTime(new Date());
        commentMapper.insert(comment);
    }

    @Override
    public void delete(Long diaryId,Long id) {
        commentMapper.delete(diaryId,id);
    }


    @Override
    public List<Comment> find(Long id) {
        return commentMapper.find(id);
    }
}
